public class multiplication {
	static long x = 1234567890;
	static long y = 2123456789;
	static int counter1=0;
	static int counter2=0;
	static long[] arr1 = new long[100];
	static long[][] arr2 = new long[100][100];
	
	public static void multi(long x, long y)
	{
		int count=0;
		int c1=0,c2=0;
		while(y!=0){
			count++;
			long a=x;
			int ost=0;
			while(a!=0){
				arr2[counter1][counter2] = ((y%10)*(a%10)+ost)%10;
				ost=(int)(((y%10)*(a%10)+ost)/10);
					a=a/10;
					counter2++;
					if(a==0){
						arr2[counter1][counter2] = ost;
						ost=0;
					}
			}
			y=y/10;
			c1=counter1;
			c2=counter2;
			counter2=count;
			counter1++;
		}
		for(int i=c2; i>=0; i--){
			for(int j=c1; j>=0; j--){
				arr1[i] += arr2[j][i];
			}
		}	
	}

	public static void main(String[] args) {
		
		System.out.print(x + " * " + y + " = ");
		multi(x,y);
		for(int i=counter1; i>=0; i--){
			System.out.print(arr1[i]);
		}
	}}
